package main

import "fmt"

func modifyInt(a int) {
  a = 1000
}

func modifyInt2(a *int){
  *a = 1000
}

func testPoint(){
  var b int = 10
  modifyInt(b) //值拷贝
  fmt.Printf("b=%d\n",b) //b=10
}

func testPoint2(){
  var b int = 10
  modifyInt2(&b) //值拷贝
  fmt.Printf("b=%d\n",b) //b=1000
}

func testPoint3(){
  var a int = 10
  var b *int = &a
  var c *int = b
  *c = 200
  fmt.Printf("*c=%d *b=%d a=%d\n",*c,*b,a) //*c=200 *b=200 a=200
}

func main() {
  //testPoint()
  //testPoint2()
  testPoint3()
}
